<?php $this -> load -> view('adminx/header'); ?>
<!-- BEGIN CONTAINER -->
<div class="page-container">
	<!-- BEGIN SIDEBAR -->
	<?php $this -> load -> view('adminx/mune'); ?>
	<!-- END SIDEBAR -->
	<!-- BEGIN CONTENT -->
	<div class="page-content-wrapper">
		<div class="page-content">
			<!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
			<!-- /.modal -->
			<h3 class="page-title"> <?php echo $title; ?> <small><?php echo $en; ?></small></h3>
			<div class="page-bar">
				<ul class="page-breadcrumb">
					<li>
						<i class="fa fa-home"></i>
						<a href="/adminx">首页</a>
						<i class="fa fa-angle-right"></i>
					</li>
					<li>
						<a href="#"><?php echo $title; ?></a>
					</li>
				</ul>
			</div>
			<!-- END PAGE HEADER-->
			<div class="clearfix"></div>
			<div class="row">
				<div class="col-md-12 col-sm-12">
					<!-- BEGIN REGIONAL STATS PORTLET-->
					<div class="note note-success">
						<p>1，只有微店店长可以接收现金红包；</p>
						<p>2，大东家的MID（即上家MID）的内容为会员的ID号；</p>
						<p>3，设置为微店店长的时候，该会员会收到微信信息提醒；</p>
					</div>
					<div class="portlet light ">
						<div class="portlet-title">
							<div class="caption">
								<i class="icon-share font-red-sunglo"></i>
								<span class="caption-subject font-red-sunglo bold uppercase">会员管理</span>
							</div>
							<div class="actions">
								<a class="btn btn-circle btn-icon-only blue" href="javascript:;" onclick="alert_ts('<?php echo $this -> config -> item('xt_ts'); ?>')"> <i class=" icon-bulb"></i> </a>
								<a class="btn btn-circle btn-icon-only green refresh" href="javascript:;" > <i class="icon-refresh"></i> </a>
								<a class="btn btn-circle btn-icon-only red" href="javascript:;"><i class="icon-trash"></i></a>
								<a class="btn btn-circle btn-icon-only btn-default fullscreen" href="javascript:;"> </a>
							</div>
						</div>
						<div class="portlet-body">
							<div class="btn-toolbar margin-bottom-10">
								<form class="btn-toolbar" id="get_tbody" onkeydown="if(event.keyCode==13)return false;">
									<div class="input-group" style="max-width: 250px;margin-right: 10px;">
						                 <input type="text" class="form-control form_datetimex"  id="day1" name="day1" value="<?php echo date('Y-m-d',strtotime('-7day')); ?>">
                                          <span class="input-group-btn">
                                              <button class="btn btn-default" type="button">-</button>
                                           </span>
                                          <input type="text" class="form-control form_datetimex"  id="day2" name="day2" value="<?php echo date('Y-m-d'); ?>">
                                       </div>
									<div class="portlet-input input-inline" style="margin-left: 10px;width: 150px;">
										<div class="input-icon right">
											<i class="icon-magnifier"></i>
											<input id="key" name="key" type="text" class="form-control" placeholder="search...">
										</div>
									</div>
									<div class="portlet-input input-inline" style="margin-left: 10px;width: 150px;">
										<div class="input-icon right">
											<i class="icon-magnifier"></i>
											<input id="openid" name="openid" type="text" class="form-control" placeholder="openid...">
										</div>
									</div>
									<div class="portlet-input input-inline">
										<select  id="page" name="page" class="form-control input-circle" style="width: 100px;">
											<option>1</option>
										</select>
									</div>
									<div class="portlet-input input-inline">
										<select  id="typex" name="type" class="form-control input-circle" style="width: 100px;">
											<option value="0">全部</option>
											<option value="1">普通会员</option>
											<option value="2">准微店长</option>
											<option value="3">微店店长</option>
											<option value="4">禁言</option>
										</select>
									</div>
								</form>
							</div>
							<div class=""></div>
							<div class="table-scrollable table-scrollable-borderless">
								<table class="table table-hover table-light">
									<thead>
										<tr>
											<th># </th>
											<th>头像</th>
											<th>个人信息</th>
											<th>类型</th>
											<th>订阅时间</th>
											<th>操作</th>
										</tr>
									</thead>
									<tbody id="tbody">
									</tbody>
								</table>
							</div>
						</div>
					</div>
					<!-- END REGIONAL STATS PORTLET-->
				</div>
			</div>
		</div>
	</div>
	
	
<div class="modal fade" id="show_up">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
					&times;
				</button>
				<h4 class="modal-title" id="fl_title">会员信息设置</h4>
			</div>
			<form role="form" id="upx" enctype="multipart/form-data">
			<div class="modal-body">
				<div id="content"></div>
				    <div class="form-group form-md-line-input">
						<input id="tj_mid" class="form-control  required" name="mphone"/>
						<label>登录账户（手机）</label>
					</div>
					<div class="form-group form-md-line-input">
						<input id="tj_mid" class="form-control  required" type="password" name="yzm"/>
						<label>密码</label>
					</div>
					<div class="form-group form-md-line-input">
						<input id="tj_mid" class="form-control number required" name="tj_mid"/>
						<label>大东家MID</label>
					</div>
					<div class="form-group form-md-line-input has-info">
						<select class="form-control" name="type" id="type">
							<option value="1">普通客户</option>
							<option value="2">准微店店长</option>
							<option value="3">微店店长</option>
							<option value="4">禁言</option>
						</select>
						<label>分类</label>
					</div>
					<div class="form-group form-md-line-input has-info">
						<select class="form-control" name="kf_account" id="kf_account">
							<?php
							$q = $this -> db -> get_where('plug_kf', array('status >' => 0));
							$kf = $q -> result_array();
							foreach($kf as $v){
							?>
							<option value="<?php echo $v['kf_account'];?>"><?php echo $v['kf_account'],' ',$v['kf_nick'];?></option>
							<?php } ?>
						</select>
						<label>多客服</label>
					</div>
					<div class="form-group form-group form-md-line-input">
						<input id="bz" class="form-control required" name="bz" />
						<label>备注</label>
					</div>
					
				
			</div>
			<div class="modal-footer">
				<button type="button" class="btn default" data-dismiss="modal">
					<i class="fa fa-compress"></i>
					关 闭
				</button>
				<button type="submit" class="btn default blue">
					<i class="fa fa-send"></i>
					设置
				</button>
			</div>
			<input name="idx" id="upidx" value="0" type="hidden" />
			</form>
		</div>
	</div>
</div>

<div class="modal fade" id="ewm">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
					&times;
				</button>
				<h4 class="modal-title" id="fl_title"><span id="ewm_title"></span>永久二维码</h4>
			</div>
			<div class="modal-body">
				<img style="width: 100%;" id="ewm_img" src="" class="img-responsive" />
			</div>
			<div class="modal-footer">
				<button type="button" class="btn blue" data-dismiss="modal">
					<i class="fa fa-send"></i>
					好的
				</button>
			</div>
		</div>
	</div>
</div>

<div class="modal fade" id="get_tj">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
					&times;
				</button>
				<h4 class="modal-title" id="fl_title"><span id="get_tj_title"></span>获取统计数据</h4>
			</div>
			<div class="modal-body">
				    <div class="form-group form-md-line-input">
						<input id="tj_time1" class="form-control number required" name="tj_time1" value="<?php echo date('Y-m-d',strtotime('-7day'));?>"/>
						<label>开始统计时间</label>
					</div>
					<div class="form-group form-md-line-input">
						<input id="tj_time2" class="form-control number required" name="tj_time2" value="<?php echo date('Y-m-d'); ?>"/>
						<label>统计结束时间</label>
					</div>
					<input type="hidden" id="tj_mid" value="0" />
					<br />
					<p id="tj_jg"></p>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn default" data-dismiss="modal">
					<i class="fa fa-send"></i>
					 关闭
				</button>
				<button onclick="do_get_tj()" type="button" class="btn  blue">
					<i class="fa fa-send"></i>
					统计
				</button>
			</div>
		</div>
	</div>
</div>

	<!-- BEGIN QUICK SIDEBAR -->
	<?php $this -> load -> view('adminx/lt'); ?>
	<!-- END QUICK SIDEBAR -->
</div>
<!-- END CONTAINER -->
<!-- BEGIN FOOTER -->
<?php $this -> load -> view('adminx/footer'); ?>
<script>
    var _model='member';
</script>
<script src="/mex/lance/domodel.js"></script>
<script>
	function get_tj(_mid,_name){
		$("#get_tj_title").text('【'+_name+'】');
		$("#tj_mid").val(_mid);
		$("#get_tj").modal("show");
		$("#tj_jg").text('');
	}
	function do_get_tj(){
		$.ajax({
		url : '/iadmin/member/get_tj',
		dataType : "json",
		type : "post",
		data:{
			mid:$("#tj_mid").val(),
			time1:$("#tj_time1").val(),
			time2:$("#tj_time2").val()
		},
		success : function(msg) {
			if (msg.type == 1) {
				$("#tj_jg").text(msg.content);
			} 

		}
	});
	}
</script>